package foodmaterial.entity;

import foodmaterial.action.valid.ObjectNullValid;

import javax.validation.Valid;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.Size;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;

public class RecipeTemplate implements Serializable {
    private static final long serialVersionUID = -1667877226936070095L;
    private Long id ;
    @NotEmpty(message = "菜谱模板名称不能为空")
    private String name ;
    @ObjectNullValid(message = "菜谱类型不能为空")
    private Long recipeTypeId ;
    private String recipeTypeName ;
    private Boolean stop ;
    private BigDecimal price ;
    private BigDecimal oldPrice ;
    private Integer totalAmount ;//下订单的时候所定菜式的数量
    private String pic ;
    private Integer weight ;
    private Integer expressionUnit ;
    @Size(min= 1,message = "菜谱至少有一条明细")
    @Valid
    private List<RecipeTemplateDetails> details ;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Long getRecipeTypeId() {
        return recipeTypeId;
    }

    public void setRecipeTypeId(Long recipeTypeId) {
        this.recipeTypeId = recipeTypeId;
    }

    public String getRecipeTypeName() {
        return recipeTypeName;
    }

    public void setRecipeTypeName(String recipeTypeName) {
        this.recipeTypeName = recipeTypeName;
    }

    public Boolean getStop() {
        return stop;
    }

    public void setStop(Boolean stop) {
        this.stop = stop;
    }

    public BigDecimal getPrice() {
        return price;
    }

    public void setPrice(BigDecimal price) {
        this.price = price;
        this.oldPrice = price ;
    }

    public BigDecimal getOldPrice() {
        return oldPrice;
    }

    public Integer getTotalAmount() {
        return totalAmount;
    }

    public void setTotalAmount(Integer totalAmount) {
        this.totalAmount = totalAmount;
    }

    public String getPic() {
        return pic;
    }

    public void setPic(String pic) {
        this.pic = pic;
    }

    public Integer getWeight() {
        return weight;
    }

    public void setWeight(Integer weight) {
        this.weight = weight;
    }

    public Integer getExpressionUnit() {
        return expressionUnit;
    }

    public void setExpressionUnit(Integer expressionUnit) {
        this.expressionUnit = expressionUnit;
    }

    public List<RecipeTemplateDetails> getDetails() {
        return details;
    }

    public void setDetails(List<RecipeTemplateDetails> details) {
        this.details = details;
    }
}
